Component({
  mixins: [],
  data: {
		animation:'',
		// bg:{
		// 	url:'https://img.alicdn.com/imgextra/i1/4161056916/O1CN01ynMjRo20xZqiv2gD5_!!4161056916.png'
		// },

		// seeShop:{
		// 	url:'https://img.alicdn.com/imgextra/i2/4161056916/O1CN01S0990J20xZqpRtYQE_!!4161056916.png'
		// },

		// radomImg:{
		// 	url:'https://img.alicdn.com/imgextra/i4/4161056916/O1CN01CIwY2f20xZqoC16Dl_!!4161056916.png'
		// },

		// againImg:{
		// 	url:'https://img.alicdn.com/imgextra/i2/4161056916/O1CN01QPaYRx20xZqnuFX0Q_!!4161056916.png'
		// },
		
		// listImg:{
		// 	url:'https://img.alicdn.com/imgextra/i4/4161056916/O1CN01WK3h1A20xZqfz7xJB_!!4161056916.png'
		// },
		
		endPrizeNum:false
  },
  props: {
		activityInfo:''
	},
	onInit(){
    this.setData({
       ...getApp().pifu.gameResultPage,
    })
		this.isEndPrizeNum()
	},
  didMount() {
    this.animation = my.createAnimation();

    this.animation.translate('0%','150%').step()
		this.setData({ animation: this.animation.export() })
		

  },
  didUpdate() {},
  didUnmount() {},
  methods: {

		isEndPrizeNum(){
			getApp().cloud.application.httpRequest({
      'path' : '/api/c/task/viewIsFinish', 
      'method':'POST',
      'headers':{ "Content-Type":"application/json"},
      'params':{},
      'body':{
				level:this.props.popData.levelInfo.difficulty
			},
      'exts':{}  }).then(res => {
				this.setData({
					endPrizeNum:!res.data
				})
			})
		},

    closeList(){
      
      this.animation.translate('0%','-150%').step()
      this.setData({ animation: this.animation.export() })

      setTimeout(() => {
        this.$page.setData({
          isScroll:false,
          isShowGameResultPopLoser:false
        })
      }, 400);
    },

    list(){
      // this.$page.setData({
      //   isShowList:true
			// })
			this.$page.showList()
    },

    goShop(){
      my.tb.openDetail ({
        itemId: this.props.popData.levelInfo.productId.toString(),
        success: (res) => {
          //浏览商品种草
          this.$page.viewProduct(this.props.popData.levelInfo.difficulty);
        }
      });
    },

    again(){

      this.animation.translate('0%','-150%').step()
      this.setData({ animation: this.animation.export() })

      setTimeout(() => {
        this.$page.startGame()

        this.$page.setData({
          isShowGameResultPopLoser:false
        })
      }, 400);
      
      
    }

  },
});